package ran.controller.user;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import ran.controller.BaseController;
import ran.domain.user.dto.UserDTO;
import ran.domain.user.dto.UserQueryDTO;
import ran.entity.Result;
import ran.entity.TableDataInfo;
import ran.service.user.IUserService;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ran
 * Date: 2025-11-01
 * Time: 17:06
 */
@RestController
@RequestMapping("/user")
public class UserController extends BaseController {
    @Autowired
    private IUserService userService;
    @GetMapping("/list")
    public TableDataInfo list(UserQueryDTO userQueryDTO) {
        return toTableDataInfo(userService.list(userQueryDTO));
    }

    @PutMapping("/updateStatus")
    public Result<Void> updateStatus(@RequestBody UserDTO userDTO) {
        // TODO 拉黑限制功能, 解禁恢复功能
        return toResult(userService.updateStatus(userDTO));
    }
}
